<template>
  <div class="content">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="充币记录" name="first">
        <el-table
        v-loading='showLoading'
        max-height='500'
        :header-cell-style="{'background-color':'#303030','font-weight':'bold'}"
        :data='myEnstrumentData'
      > 
        <el-table-column
          :label='"时间"'>
          <template slot-scope="scope">
            {{scope.row.wdate}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"币种"'>
          <template slot-scope="scope">
            {{scope.row.coin}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"数量"'>
          <template slot-scope="scope">
            {{parseFloat(scope.row.number)}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"哈希值"' >
          <template slot-scope="scope">
            {{scope.row.hash}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"到账地址"'>
          <template slot-scope="scope">
            {{scope.row.toaddress}}
          </template>
        </el-table-column>
        <el-table-column
          sortable
          width='80'
          :label='"状态"'
        >
          <span
            slot-scope="scope"
            v-text="scope.row.state=='0'?'审核中':(scope.row.state=='1'?'已完成':'已驳回')"
          ></span>
        </el-table-column>
      </el-table>
      </el-tab-pane>
      <el-tab-pane label="提币记录" name="second">
        <el-table
        v-loading='showLoading'
        max-height='500'
        :header-cell-style="{'background-color':'#303030','font-weight':'bold'}"
        :data='myEnstrumentDatas'
      > 
        <el-table-column
          :label='"时间"' width="150">
          <template slot-scope="scope" >
            {{scope.row.wdate}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"币种"' width="130">
          <template slot-scope="scope">
            {{scope.row.coin}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"数量"' width="130">
          <template slot-scope="scope">
             {{parseFloat(scope.row.number)}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"矿工费"' width="130">
          <template slot-scope="scope">
            {{scope.row.gas}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"哈希值"'>
          <template slot-scope="scope">
            {{scope.row.hash}}
          </template>
        </el-table-column>
        <el-table-column
          :label='"到账地址"'>
          <template slot-scope="scope">
            {{scope.row.toaddress}}
          </template>
        </el-table-column>
        <el-table-column
          sortable
          width='80'
          :label='"状态"'
        >
          <span
            slot-scope="scope"
            v-text="scope.row.state=='0'?'审核中':(scope.row.state=='1'?'已完成':'已驳回')"
          ></span>
        </el-table-column>
      </el-table>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<style lang="scss" scoped>
.table-wrap {
  // border: $default-border;
  border-bottom: none;
}
.title {
  padding-bottom: 15px;
  margin-bottom: 10px;
  color: #DDDDDD;
  border-bottom: 1px solid #2F2F2F;
}
</style>
<script>
export default {
  data() {
    return {
      showLoading: true,
      myEnstrumentData: [],
      activeName: 'first',
    };
  },
  mounted() {
    this.request(this.api.getcoininlist,{pagesize:'60',pagecode:'1'}).then(res => {
      this.showLoading = false;
      if (res && res.code != "0") {
        this.getDataFaild(res.msg);
        return false;
      }
      res.data && res.data && (this.myEnstrumentData = res.data);
    });
    this.request(this.api.getcoinoutlist,{pagesize:'60',pagecode:'1'}).then(res => {
      this.showLoading = false;
      if (res && res.code != "0") {
        this.getDataFaild(res.msg);
        return false;
      }
      res.data && res.data && (this.myEnstrumentDatas = res.data);
    });
  }
};
</script>